<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>初识vue</title>
    <script type="text/javascript" src="../js/vue.js"></script>
  </head>

  <body>
    <div id="root">
      <span> cl - {{msg}} </span>
    </div>
    <script type="text/javascript">
      Vue.config.productionTip = false; //  关闭提示
      // 创建一个vue实例
      // 一个容器对应一个实例
      const vm = new Vue({
        el: "#root", //element
        data: {
          msg: "hello vue",
        }, //data
        methods: {
          //methods
          change() {
            this.msg = "hello world";
          },
        },
        // computed: {
        //   // computed
        //   msg() {
        //     return "hello world";
        //   },
        // },
      });
    </script>
  </body>
</html>
